﻿using System.Data.Entity.ModelConfiguration;

namespace HobSoft.SoccerBet2014.Domain.Models.DbSchema
{
    public class BFAccountConfiguation : EntityTypeConfiguration<BFAccount>
    {
        public BFAccountConfiguation(string schema = "dbo")
        {
            ToTable(schema + ".Users");
            HasKey(be => be.Account);
            Property(be => be.Account).HasColumnName("UserName").IsRequired().HasMaxLength(50);
            Property(be => be.Password).HasColumnName("Password").IsRequired().HasMaxLength(500);
            Property(be => be.Session).HasColumnName("SessionToken").IsRequired().HasMaxLength(200);
            Property(be => be.AppKey).HasColumnName("AppKey").IsRequired().HasMaxLength(50);
            Property(be => be.LastRequestTime).HasColumnName("LastActive").IsRequired();
            Property(be => be.Disable).HasColumnName("IsLock").IsRequired();
            Ignore(be => be.Discount);
        }
    }
}
